#include<iostream>
using namespace std;
int main(){
    int t,n,m,eff,a;
    cin>>t;
    while (t--)
    {
        cin>>n>>m;
        eff=100;
        while(n--){
            cin>>a;
            if(eff>a) eff=a;
        }
        cout<<(100-eff)*(100-eff)<<endl;
    }
    
}